<?php 

$minDay=10;
if ($_GET['day']){
    $minDay=$_GET['day'];
}

$time=time()-60*60*24*$minDay;
$theday=date("Y-m-d",$time);
echo $theday;
echo "<br />";



?>